package usually;

import java.util.Arrays;

//242. 有效的字母异位词
public class Num242_isAnagram {
    public boolean isAnagram(String s, String t) {
        if (s.length() != t.length())return false;
        int arrs[] = new int[26];
        int arrt[] = new int[26];
        for (int i = 0; i < s.length(); i++) {
            arrs[s.charAt(i) - 'a']++;
            arrt[t.charAt(i) - 'a']++;
        }
        return Arrays.equals(arrs,arrt);
    }
}
